package com.likeyoudo.views.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.likeyoudo.common.BaseFragment;
import com.likeyoudo.views.R;
import com.likeyoudo.views.databinding.FragmentImagePreviewBinding;

/**
 * @author LikeYouDo
 * @date 2024/1/8 16:24
 */
public class ImagePreviewFragment extends BaseFragment {

    private String picUrl;

    FragmentImagePreviewBinding binding;

    public ImagePreviewFragment(String picUrl) {
        this.picUrl = picUrl;
    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_image_preview;
    }

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        binding = FragmentImagePreviewBinding.inflate(inflater, container, false);
        //设置图片
        Glide.with(this).load(picUrl).into(binding.imageView);
        return binding.getRoot();
    }
}
